function InstallFunction(obj,functionName)
{
  obj[functionName] = function() { Request(functionName,arguments,'/rpc'); }
}

var report_server = {};
InstallFunction(report_server,'displayReport');

function DisplayReport(report_type,source_element_id)
{
  var element = document.getElementById(source_element_id);
  var element_value = element.options[element.selectedIndex].value;
  report_server.displayReport(report_type,element_value,DisplayReportSuccess);
}

function DisplayReportSuccess(response)
{
  if(response)
  {
    $("#usage-report-display").html(response);
  } else {
    $("#usage-report-display").html("ERROR generating report, remote call to server failed");
  }
}